#ifndef CHAPTER12_PRACTICE2_STRING2_H_
#define CHAPTER12_PRACTICE2_STRING2_H_

#include <iostream>
using std::ostream;
using std::istream;
class String
{
private:
	char * str;			//pointer to string
	int len;			//length of string
	static int num_strings;	//number of objects
	static const int CINLIM = 80;	//cin input limit
public:
	//constructors and other metheds
	String(const char * s);		//constructor
	String();						//default constuctor
	String(const String &);	//copy constructor
	~String();						//destructor
	int length() const { return len; };
	//overloaded operator methods
	String & operator=(const String &);
	String & operator=(const char *);
	char & operator[](int i);
	const char & operator[] (int i) const;
	//overloaded operator friends
	//friend bool operator<(const String_12_4 &st, const String_12_4 &st2);
	//friend bool operator>(const String_12_4 &st1, const String_12_4 &st2);
	friend bool operator==(const String &st, const String &st2);
	friend ostream & operator<<(ostream & os, const String & st);
	friend istream & operator >> (istream & is, String & st);

	//static function
	static int HowMany();

	//practice add
	String operator+(const String &) const;
	friend String operator+(const char *, const String &);
	void Stringlow();
	void Stringup();
	int has(char);
};
#endif
